<template>
	<view>
		<view>
			{{name}}
			{{age}}
		</view>
		<view @tap="tap" style="border-color: black;">组件位置</view>
		<view>
			<u-input v-model="data"></u-input>
		</view>
		<slot>eee</slot>
		<slot name="footer">
			<u-button>按钮</u-button>
		</slot>
	</view>
</template>

<script>
	export default {
		name: "myTest",
		data() {
			return {
				data: ''
			};
		},
		onLoad() {
			// 子组件里不执行
			console.log('onLoad')
		},
		onReady() {
			// 子组件里不执行
			console.log('onReady')
		},
		created() {
			console.log('created');
			this.data = this.name
		},
		mounted() {
			console.log('mounted')
		},
		methods: {
			tap() {
				console.log('tap')
				this.$emit('confirm', 'con');
			}
		},
		props: {
			name: {
				type: String,
				default: '小明'
			},
			age: {
				type: Number,
				default: 20
			},
			userinfo: {
				type: Object,
				dafault() {
					return {}
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
